﻿
using QFramework;
using System.Collections.Generic;

namespace ProjectChildhood
{
    public class Config
    {
        public const float INIT_GOLD = 0;
        public const int INIT_DAY = 1;
        public const int INIT_GRID_WIDTH = 5;
        public const int INIT_GRID_HEIGHT = 4;

        public static Dictionary<string, Item> ItemWithName = new Dictionary<string, Item>()
        {
            {"hand", CreateToolHand() },
            {"shovel", CreateToolShovel() },
            {"waterscan", CreateToolWaterScan() },
            {"seed", CreateToolSeedFruit() },
            {"seed_carrot", CreateToolSeedCarrot() },
            {"carrot", CreateCarrot() },
            {"seed_pumpkin", CreateToolSeedPumpkin() },
            {"pumpkin", CreatePumpkin() },
            {"seed_potato", CreateToolSeedPotato() },
            {"potato", CreatePotato() },
            {"seed_tomato", CreateToolSeedTomato() },
            {"tomato", CreateTomato() },
            {"seed_bean", CreateToolSeedBean() },
            {"bean", CreateBean() },
        };

        public static Item CreateToolHand(int count = 1)
        {
            return new Item()
            {
                Name = "hand",
                Icon = "Tool_Hand",
                Countable = false,
                IsPlant = false,
                PlantPrefab = string.Empty,
                Tool = new ToolHand()
            };
        }

        public static Item CreateToolShovel(int count = 1)
        {
            return new Item()
            {
                Name = "shovel",
                Icon = "Tool_Shovel",
                Countable = false,
                IsPlant = false,
                PlantPrefab = string.Empty,
                Tool = new ToolShovel()
            };
        }

        public static Item CreateToolWaterScan(int count = 1)
        {
            return new Item()
            {
                Name = "waterscan",
                Icon = "Tool_WaterScan",
                Countable = false,
                IsPlant = false,
                PlantPrefab = string.Empty,
                Tool = new ToolWaterScan()
            };
        }

        public static Item CreateToolSeedFruit(int count = 1)
        {
            return new Item()
            {
                Name = "seed",
                Icon = "Tool_Seed_Fruit",
                Countable = true,
                IsPlant = true,
                PlantPrefab = "Plant_Fruit",
                Tool = new ToolSeed()
            };
        }

        public static Item CreateToolSeedCarrot(int count = 1)
        {
            return new Item()
            {
                Name = "seed_carrot",
                Icon = "Tool_Seed_Carrot",
                Countable = true,
                IsPlant = true,
                PlantPrefab = "Plant_Carrot",
                Tool = new ToolSeed()
            };
        }

        public static Item CreateCarrot(int count = 1)
        {
            return new Item()
            {
                Name = "carrot",
                Icon = "CarrotItem",
                Countable = true,
                IsPlant = false,
                PlantPrefab = string.Empty,
                Tool = null
            };
        }

        public static Item CreateToolSeedPumpkin(int count = 1)
        {
            return new Item()
            {
                Name = "seed_pumpkin",
                Icon = "Tool_Seed_Pumpkin",
                Countable = true,
                IsPlant = true,
                PlantPrefab = "Plant_Pumpkin",
                Tool = new ToolSeed()
            };
        }

        public static Item CreatePumpkin(int count = 1)
        {
            return new Item()
            {
                Name = "pumpkin",
                Icon = "PumpkinItem",
                Countable = true,
                IsPlant = false,
                PlantPrefab = string.Empty,
                Tool = null
            };
        }

        public static Item CreateToolSeedPotato(int count = 1)
        {
            return new Item()
            {
                Name = "seed_potato",
                Icon = "Tool_Seed_Potato",
                Countable = true,
                IsPlant = true,
                PlantPrefab = "Plant_Potato",
                Tool = new ToolSeed()
            };
        }

        public static Item CreatePotato(int count = 1)
        {
            return new Item()
            {
                Name = "potato",
                Icon = "PotatoItem",
                Countable = true,
                IsPlant = false,
                PlantPrefab = string.Empty,
                Tool = null
            };
        }

        public static Item CreateToolSeedTomato(int count = 1)
        {
            return new Item()
            {
                Name = "seed_tomato",
                Icon = "Tool_Seed_Tomato",
                Countable = true,
                IsPlant = true,
                PlantPrefab = "Plant_Tomato",
                Tool = new ToolSeed()
            };
        }

        public static Item CreateTomato(int count = 1)
        {
            return new Item()
            {
                Name = "tomato",
                Icon = "TomatoItem",
                Countable = true,
                IsPlant = false,
                PlantPrefab = string.Empty,
                Tool = null
            };
        }

        public static Item CreateToolSeedBean(int count = 1)
        {
            return new Item()
            {
                Name = "seed_bean",
                Icon = "Tool_Seed_Bean",
                Countable = true,
                IsPlant = true,
                PlantPrefab = "Plant_Bean",
                Tool = new ToolSeed()
            };
        }

        public static Item CreateBean(int count = 1)
        {
            return new Item()
            {
                Name = "bean",
                Icon = "BeanItem",
                Countable = true,
                IsPlant = false,
                PlantPrefab = string.Empty,
                Tool = null
            };
        }
    }
}

